check if a key exists in a javascript object